package com.recipedb.recipedb.service.impl;

import com.recipedb.recipedb.entity.RecipeDifficultyVote;
import com.recipedb.recipedb.entity.RecipeDifficultyVoteId;
import com.recipedb.recipedb.repository.RecipeDifficultyVoteRepository;
import com.recipedb.recipedb.service.RecipeDifficultyVoteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;

@Service
public class RecipeDifficultyVoteServiceImpl implements RecipeDifficultyVoteService {

    @Autowired
    private RecipeDifficultyVoteRepository repository;

    @Override
    public RecipeDifficultyVote save(RecipeDifficultyVote entity) {
        return repository.save(entity);
    }

    @Override
    public void deleteById(RecipeDifficultyVoteId id) {
        repository.deleteById(id);
    }

    @Override
    public Optional<RecipeDifficultyVote> findById(RecipeDifficultyVoteId id) {
        return repository.findById(id);
    }

    @Override
    public List<RecipeDifficultyVote> findAll() {
        return repository.findAll();
    }
}
